import { $post, $put } from '@js/request'

export async function addRequest (d: { [k: string]: any }) {
  d.status = Number(d.status)
  const res = await $post('/api/commission/deliveraddress', d)
  return res.data
}

export async function updateRequest (d: { [k: string]: any }) {
  const id = d.id
  d.status = Number(d.status)
  delete d.id
  const res = await $put(`/api/commission/deliveraddress/${id}`, d)
  return res.data
}
